package com.imooc;

import com.imooc.controller.WelcomeController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * <h1></h1>
 *
 * @author : dzj
 * @create: 2021-10-16 19:36
 */
@Slf4j
@Configuration
@ComponentScan("com.imooc")
public class Debug0203_Entrance {

	public static void main(String[] args) {
	//	String xmlPath = "F:\\ideaProjectSource\\spring-framework-5.1.x\\spring-demo\\src\\main\\resources\\spring\\spring-config.xml";
		String xmlPath = ".\\spring\\spring-config.xml";
	//	ApplicationContext ctx = new FileSystemXmlApplicationContext(xmlPath);
		ApplicationContext ctx = new AnnotationConfigApplicationContext(Debug0203_Entrance.class);
		WelcomeController welcomeController = ctx.getBean(WelcomeController.class);
		welcomeController.handleRequest();
		for (String beanDefinitionName : ctx.getBeanDefinitionNames()) {
		//	log.info();
	//		log.info("beanDefinitionName: {}",beanDefinitionName);
		}
	}
}
